﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using uTILLIty.Rave.Contract.Configuration;

namespace uTILLIty.Rave.Core.Configuration
{
	[TestClass]
	public class MemberTests
	{
		[TestMethod]
		public void AssignIdentifier()
		{
			var target = new Member("id", "name", "type", MemberType.Unknown);
			Assert.AreEqual("name", target.Identifier);
			Assert.AreEqual("type", target.IdentificationType);
		}

		[TestMethod]
		public void AssignIdentifierWithType()
		{
			var target = new Member("id", "someName", "type", MemberType.Unknown);
			target.Identifier = "displayName=name";
			Assert.AreEqual("name", target.Identifier);
			Assert.AreEqual("displayName", target.IdentificationType);
		}

		[TestMethod]
		public void AssignIdentifierWithTypeInCtor()
		{
			var target = new Member("id", "displayName=name", "type", MemberType.Unknown);
			Assert.AreEqual("name", target.Identifier);
			Assert.AreEqual("displayName", target.IdentificationType);
		}

		[TestMethod]
		public void GroupMemberTypeCorrect()
		{
#pragma warning disable 612,618
			var target = new Group();
#pragma warning restore 612,618
			Assert.AreEqual(MemberType.Group, target.MemberType);
		}
	}
}
